<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Cadastro de Parametros</title>
</h:head>
<ui:composition template="templatePrincipal.xhtml">
	<ui:define name="header">
		<ui:include src="header.xhtml" />
	</ui:define>
	<ui:define name="centro">
		<h:body>
			<h:form id="form1" prependId="false">
				<p:tabView id="tabview1" dynamic="true" cache="false">
					<p:tab id="tabnotas" title="Cartorio de Notas">
						<h:form enctype="multipart/form-data">
							<p:panel header="Tabela de custos">
								<p:dataTable id="cnotasTable" var="cnotas"
									value="#{parametrosController.custoCNotasList}"
									paginator="true" rows="20"
									paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									rowsPerPageTemplate="3,6,9">

									<f:facet name="header">
            						Tabela de Custos do Cartório de Notas
        						</f:facet>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Limite inferior" />
										</f:facet>
										<h:outputText value="#{cnotas.intervalomin}" />
									</p:column>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Limite superior" />
										</f:facet>
										<h:outputText value="#{cnotas.intervalomax}" />
									</p:column>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Valor" />
										</f:facet>
										<h:outputText value="#{cnotas.custo}" />
									</p:column>

								</p:dataTable>
							</p:panel>
							<p:panel header="Carregar nova tabela">

								<p:messages showDetail="true" />

								<p:fileUpload
									fileUploadListener="#{parametrosController.handleCnotasXLS}"
									mode="advanced" update="messages,cnotasTable" />

								<p:growl id="messages" showDetail="true" />

							</p:panel>
						</h:form>
					</p:tab>
					<p:tab id="tabcri" title="Cartorio de Registros de Imoveis">

						<h:form enctype="multipart/form-data">
							<p:panel header="Tabela de custos">
								<p:dataTable id="custoCriTable" var="custocri"
									value="#{parametrosController.custoCRIList}" paginator="true"
									rows="20"
									paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									rowsPerPageTemplate="3,6,9">

									<f:facet name="header">
            						Tabela de Custos do Cartório de registros
        						</f:facet>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Limite inferior" />
										</f:facet>
										<h:outputText value="#{custocri.intervalomin}" />
									</p:column>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Limite superior" />
										</f:facet>
										<h:outputText value="#{custocri.intervalomax}" />
									</p:column>

									<p:column>
										<f:facet name="header">
											<h:outputText value="Valor" />
										</f:facet>
										<h:outputText value="#{custocri.custo}" />
									</p:column>

								</p:dataTable>
							</p:panel>
							<p:panel header="Carregar nova tabela">

								<p:messages showDetail="true" />

								<p:fileUpload
									fileUploadListener="#{parametrosController.handleCriXLS}"
									mode="advanced" update="messages,custoCriTable" />

								<p:growl id="messages" showDetail="true" />

							</p:panel>
						</h:form>
					</p:tab>
					<p:tab id="tabpcusto" title="Parâmetros de Custo">

							<!-- 
							double ibti;
							double vmatricula;
							double txccfgts;
							double txccsbte;
							double pesqcadastral;
							double premioseguro;
							double despachante;	
						 -->
							<p:panelGrid id="custoparams" columns="4">
								<f:facet name="header">
        						Parâmetros de custo
    						</f:facet>

								<p:outputLabel for="itbi_param" value="Itbi:" />
								<p:inputText id="itbi_param"
									value="#{parametrosController.parametroCusto.ibti}" size="20" />

								<p:outputLabel for="vmatricula_param" value="Matricula:" />
								<p:inputText id="vmatricula_param"
									value="#{parametrosController.parametroCusto.vmatricula}"
									size="20" />

								<p:outputLabel for="txccfgts_param" value="Taxa CCFGTS:" />
								<p:inputText id="txccfgts_param"
									value="#{parametrosController.parametroCusto.txccfgts}"
									size="20" />

								<p:outputLabel for="txccsbte_param" value="Taxa CCSBTE:" />
								<p:inputText id="txccsbte_param"
									value="#{parametrosController.parametroCusto.txccsbte}"
									size="20" />

								<p:outputLabel for="pesqcadastral_param"
									value="Custo Pesq. Cadastral" />
								<p:inputText id="pesqcadastral_param"
									value="#{parametrosController.parametroCusto.pesqcadastral}"
									size="20" />

								<p:outputLabel for="premioseguro_param" value="Premio Seguro" />
								<p:inputText id="premioseguro_param"
									value="#{parametrosController.parametroCusto.premioseguro}"
									size="20" />

								<p:outputLabel for="despachante_param"
									value="Custo Despachante:" />
								<p:inputText id="despachante_param"
									value="#{parametrosController.parametroCusto.despachante}"
									size="20" />


							</p:panelGrid>
							<p:messages showDetail="true" />
							<p:growl id="messages" showDetail="true" />
							<p:commandButton value="Salvar"
								actionListener="#{parametrosController.salvaCustoParams}"
								update="messages" />
							<p:commandButton value="Cancelar" type="reset" />
			
					</p:tab>
				</p:tabView>

			</h:form>
		</h:body>
	</ui:define>
</ui:composition>
</html>